<style>
    .table th{
        text-align: center;
        vertical-align:middle;
    }
    .table td{
        text-align: center;
        vertical-align:middle;
    }
</style>
<div class="row-fluid listcontent">
    <div class="span12">
        <div class="portlet box grey">
            <div class="portlet-title">
                <div class="caption"><i class="icon-cogs"></i>用户列表</div>
                <div class="actions" id="orderaline">
                    <a href="/admin/member/add" class="btn blue" id="add"><i class="icon-pencil"></i>&nbsp;&nbsp;添加虚拟用户</a>
                    <div class="btn-group">
                        <a class="btn blue" href="#" data-toggle="dropdown">
                            <i class="icon-cogs"></i>&nbsp;&nbsp;操作
                            <i class="icon-angle-down"></i>
                        </a>
                        <ul class="dropdown-menu pull-right">
                            <li><a id="info_forbidden"><i class="icon-lock"></i>禁用用户</a></li>
                            <li><a id="info_recovery"><i class="icon-unlock"></i>恢复用户</a></li>
                        </ul>
                    </div>
                    <div class="btn-group">
                        <a class="btn blue Download">
                            <i class="icon-cogs"></i>&nbsp;&nbsp;导出用户信息
                        </a>

                    </div>
                </div>
            </div>
            <div class="portlet-body">
                <div class="dataTables_wrapper form-inline">
                    <div class="row-fluid">
                        <div class="span12">
                            <form id="searchform" action="{$action}" method="post">
                                <div class="dataTables_filter" id="sample_2_filter" style="float: left">
                                    <label>
                                        <select name='state' style="width: 120px;margin-right: 10px" value="">
                                            <option value="">不限用户状态</option>
                                            <option value="1"
                                                <?php if (isset($state) && ($state == 1)) { ?>
                                                selected="selected"
                                                <?php } ?>
                                            >正常</option>
                                            <option value="2"
                                                <?php if (isset($state) && ($state == 2)) { ?>
                                                    selected="selected"
                                                <?php } ?>
                                            >冻结</option>
                                        </select>
                                    </label>
                                </div>
                                <div class="dataTables_filter" id="sample_2_filter" style="float: left">
                                    <label>
                                        <select name='type' style="width: 120px;margin-right: 10px" value="">
                                            <option value="">不限用户类型</option>
                                            <option value="1"
                                                <?php if (isset($type) && ($type == 1)) { ?>
                                                    selected="selected"
                                                <?php } ?>
                                            >真实用户</option>
                                            <option value="2"
                                                <?php if (isset($type) && ($type == 2)) { ?>
                                                    selected="selected"
                                                <?php } ?>
                                            >虚拟用户</option>
                                        </select>
                                    </label>
                                </div>
                                <div class="dataTables_filter" id="sample_2_filter" style="float: left;margin-left:10px">
                                    <select name='attestation'  style="width: 150px;margin-right: 10px">
                                        <option value="">不限认证状态</option>
                                        <option value="1"
                                            <?php if (isset($attestation) && $attestation == 1) { ?>
                                                selected="selected"
                                            <?php } ?>
                                        >未认证</option>
                                        <option value="2"
                                            <?php if (isset($attestation) && $attestation == 2) { ?>
                                                selected="selected"
                                            <?php } ?>
                                        >已认证</option>
                                        <option value="3"
                                            <?php if (isset($attestation) && $attestation == 3) { ?>
                                                selected="selected"
                                            <?php } ?>
                                        >重新认证</option>
                                        <option value="4"
                                            <?php if (isset($attestation) && $attestation == 4) { ?>
                                                selected="selected"
                                            <?php } ?>
                                        >待审核</option>
                                    </select>
                                </div>
                                <div class="dataTables_filter" id="sample_2_filter" style="float: left;margin-left:10px">
                                    <select name='sheng' id="province" style="width: 150px;margin-right: 10px">
                                        <option value="">--- 选择省 ---</option>
                                        <?php foreach ($province as $key => $vo) { ?>
                                            <option value="{$vo['district_id']}"
                                                <?php if (isset($sheng) && ($sheng == $vo['district_id'])) { ?>
                                                    selected="selected"
                                                <?php } ?> >
                                                {$vo.district}
                                            </option>
                                        <?php } ?>
                                    </select>
                                </div>
                                <div class="dataTables_filter" id="sample_2_filter" style="float: left;margin-left:10px">
                                    <select name='shi' id="city" style="width: 150px;margin-right: 10px">
                                        <option value="">--- 选择市 ---</option>
                                        <?php foreach ($city as $key => $vo) { ?>
                                            <option value="{$vo['district_id']}"
                                                <?php if (isset($shi) && ($shi == $vo['district_id'])) { ?>
                                                    selected="selected"
                                                <?php } ?> >
                                                {$vo.district}
                                            </option>
                                        <?php } ?>
                                    </select>
                                </div>
                                <div class="dataTables_filter" id="sample_2_filter" style="float: left;margin-left:10px">
                                    <select name='qu' id="area" style="width: 150px;margin-right: 10px">
                                        <option value="">--- 选择区 ---</option>
                                        <?php foreach ($district as $key => $vo) { ?>
                                            <option value="{$vo['district_id']}"
                                                <?php if (isset($qu) && ($qu == $vo['district_id'])) { ?>
                                                    selected="selected"
                                                <?php } ?> >
                                                {$vo.district}
                                            </option>
                                        <?php } ?>
                                    </select>
                                </div>
                                <div class="dataTables_filter" id="sample_2_filter" style="float: left;margin-left:10px">
                                    <label>
                                        <input type="text" name="keywords" placeholder="关键字：ID|昵称|手机号"
                                               aria-controls="sample_2" class="m-wrap"
                                               value="{$keywords?$keywords:''}" style="height:20px"/>
                                    </label>
                                </div>
                                <div class="dataTables_filter" id="sample_2_filter" style="float: left;margin-left:10px">
                                    <label>
                                        <input type="text" name="login_start"
                                               aria-controls="sample_2" class="m-wrap" value="{$login_start?$login_start:''}" style="height:20px"  onclick="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd HH:mm:ss'})" placeholder="注册开始时间"/>
                                    </label>
                                </div>
                                <div class="dataTables_filter" id="sample_2_filter" style="float: left;">
                                    <label>
                                        <input type="text" name="login_end" placeholder="注册结束时间"
                                               aria-controls="sample_2" class="m-wrap" value="{$login_end?$login_end:''}" style="height:20px"   onclick="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd HH:mm:ss'})"  />
                                    </label>
                                </div>

                                <div class="dataTables_filter" id="sample_2_filter" style="float: left;margin-left:20px;">
                                    <label>
                                        <input type="text" name="register_start"
                                               aria-controls="sample_2" class="m-wrap" value="{$register_start?$register_start:''}" style="height:20px"  onclick="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd HH:mm:ss'})" placeholder="登录开始时间"/>
                                    </label>
                                </div>
                                <div class="dataTables_filter" id="sample_2_filter" style="float: left">
                                    <label>
                                        <input type="text" name="register_end" placeholder="登录结束时间"
                                               aria-controls="sample_2" class="m-wrap" value="{$register_end?$register_end:''}" style="height:20px"   onclick="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd HH:mm:ss'})"  />
                                    </label>
                                </div>

                                <div class="dataTables_filter" id="sample_2_filter" style="float: left;margin-left:10px">
                                    <label>
                                        <input type="button" class="btn blue search" value="查询"/>
                                    </label>
                                </div>
                            </form>
                        </div>
                    </div>
                    <input type="hidden" name="page" value="{$page?$page:''}">
                    <table id="basicinfo" class="table table-hover table-bordered">
                        <thead>
                        <th style="width:8px;"><input type="checkbox"/></th>
                        <th>序号</th>
                        <th>ID</th>
                        <th>昵称</th>
                        <th>手机号</th>
                        <th>头像</th>
                        <th>注册时间</th>
                        <th>上次登录时间</th>
                        <th>省</th>
                        <th>市</th>
                        <th>区</th>
                        <th>状态</th>
                        <th>认证状态</th>
                        <th style="width:200px;">操作</th>
                        </thead>
                        <tbody>
                        {if(count($list)>0)}
                        {volist name='list' id='val' k='key'}
                        <tr class="odd gradeX ">
                            <td><input type="checkbox" class="checkboxes" name="id" value="{$val.user_id}"/></td>
                            <td>{:xuHao($key,$pages)}</td>
                            <td>{$val.user_id}</td>
                            <td>{$val.user_username}</td>
                            <td>{$val.user_phone}</td>
                            <td>
                                <?php if($val['user_image'] != ""){ ?>
                                <img src="{$val.user_image}" style="width:100px;height:100px">
                                <?php } ?>
                            </td>
                            <td>{$val.user_time}</td>
                            <td>{$val.user_last_login}</td>
                            <td>{$val.sheng}</td>
                            <td>{$val.shi}</td>
                            <td>{$val.qu}</td>
                            <td>
                                <?php if($val['user_status'] == 1){?>
                                    <span class="label label-info">正常</span>
                                <?php }else{ ?>
                                    <span class="label label-danger" style="background:red;">冻结</span>
                                <?php } ?>
                            </td>
                            <td>
                                <?php if($val['user_attestation'] == 1){ ?>
                                    未认证
                                <?php }elseif($val['user_attestation'] == 4){?>
                                    待审核
                                <?php }else if($val['user_attestation'] == 2){ ?>
                                    已认证
                                <?php }else if($val['user_attestation'] == 3){ ?>
                                    重新认证
                                <?php } ?>
                            </td>
                            <td>
                                <a class="btn mini reset purple look" data-id='{$val.user_id}'><span>个人信息</span></a>
                                <a class="btn mini examine blue buy" style="margin-top:5px" data-id='{$val.user_id}'><span>购买记录</span></a>
                                <a class="btn mini send" style="margin-top:5px" data-id='{$val.user_id}'><span>发布的信息</span></a>
                                <?php if($val['user_attestation'] == 2){ ?>
                                <a class="btn mini green check" style="margin-top:5px" data-id='{$val.user_id}'><span>查看</span></a>
                                <?php }else{ ?>
                                    <a class="btn mini green check" style="margin-top:5px" data-id='{$val.user_id}'><span>审核</span></a>
                                <?php } ?>
                            </td>
                        </tr>
                        {/volist}
                        {else/}
                        <tr>
                            <td colspan="16"><span style="margin-left: 50px">暂无数据</span></td>
                        </tr>
                        {/if}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        {if(!empty($list))}
        {$list->render()}
        {/if}
    </div>
</div>
